home *** CD-ROM | disk | FTP | other *** search
- DRAW Michael J. Mefford
- Command 1987/No. 9
-
- ______________________________________________________
-
- Purpose: Provides low-resolution (320 x 200) color or
- high-resolution (640 x 200) monochrome
- drawing capabilities on a color, enhanced
- color, or (with some MGA boards) a monochrome
- display, without the need to work in BASIC.
-
- Format: [d:][path]DRAW[/K] (Option I)
- [d:][path]DRAW string[/K] (Option I)
- [d:][path]DRAW filespec/F[/K] (Option II)
-
- Remarks: Entered at the DOS prompt with no arguments
- on the command line (Option I), DRAW looks in
- the current directory for a file named
- DRAW.DAT and executes the commands in that
- file. A sample DRAW.DAT file is included on
- this disk. The file can be examined, and
- similar files created, with a regular ASCII
- word processor.
-
- Alternatively, DRAW can be entered with a
- string of commands (Option II, for a simple
- graphic) or with the name of a file
- consisting of commands (Option III). Any
- legal DOS filename may be used, and full path
- support is provided, but a /F terminator must
- be appended to the filename. An optional /K
- may be added to prevent a keystroke from
- halting execution.
-
- Example: You can get a feel for how DRAW operates by
- entering, at the DOS prompt:
-
- DRAW X0 C2 BU50 M+40,70 L80 M+40,-70 BD5 P2,2
-
- This will create a red triangle in the middle
- of your screen. You can trace the specific
- steps in this command sequence by referring
- to The DRAW Command Set table, presented on
- succeeding pages in this manual.
-
- The DRAW Command Set
-
- Xn Change to low resolution 320X200 color graphics.
-
- If X is not found, the default is 640X200 high
- resolution black and white graphics. X must be
- the first character of the command line or the
- first character in a file.
-
- The palette will be changed to n, where n can be
- either zero or one. See C color command below for
- the color of each palette.
-
- K Do not poll the keyboard while drawing. If K is
- not found, any keystroke terminates the program.
-
- Sn Flood the screen color to pattern n. n must be a
- decimal number in the range 0-255, and represents
- an eight bit pattern. Normally this command is
- issued immediately after the X command (if
- present), to clear the screen with a background
- color other than black. For example, to clear to
- color red (2) in low resolution, the command is
- S170 (binary 10101010).
-
- color 320X200 640X200
- 0 0 0
- 1 85 255
- 2 170 NA
- 3 255 NA
-
- Pattern colors may also be used. For example, a
- pattern of half green and half black would be S58
- (binary 01000100). In high resolution, each bit
- represents a dot, eight dots per byte. This is
- why only two colors (black or white) are
- available. In low resolution, there are two bits
- per dot, so four combinations can be represented.
- In the example here the sequence is 01 (green), 00
- (black), 01 (green), 00 (black). See C (color)
- command below for complete coding of the colors.
-
- U,D,L,R,E,F,G,H
- These commands, followed by a number, will move in
- one of the following compass directions:
-
- U
- H | E
- \ | /
- \ | /
- \ | /
- L -- -- -- + -- -- -- R
- / | \
- / | \
- / | \
- G | F
- D
-
- Mx,y Move x,y units either relative to the current
- position or to the absolute coordinates, x,y. If
- the x coordinate is prefaced with either a plus
- sign or minus sign, the move is relative.
- Otherwise, the move is absolute. Note, you do not
- need to include a plus sign in front of the y
- coordinate in a positive y move.
-
- Pp,b Paint the color p until the border color b is
- found. The paint originates from the current
- position.
-
- B Blank move. The move following a B will move the
- desired units without plotting points. The next
- command will then continue drawing.
-
- N No update. The draw command following an N
- command will plot points, but the position will
- not be updated. The next draw command will start
- at the same position as the last.
-
- Cn Change the color to n. All draws after a C
- command will be in color n. n can be 0 (black) or
- 1 (white) in high resolution and 0 to 3 in low
- resolution. In low resolution, the color is
- dependent on the palette.
-
- 320X200 640X200
- color palette 0 palette 1
- 0 black black black
- 1 green cyan white
- 2 red magenta NA
- 3 yellow white NA
-
- RELATED COMMANDS
-
- Four commands, BSAVE.COM, BLOAD.COM,
- LOWRES.COM, and HIGHRES.COM, are included on
- this disk to speed the display of pictures
- created by DRAW. (BSAVE and BLOAD may also
- be used with text screens for instant
- presentation.) The command
-
- BSAVE filespec
-
- saves a byte image of the screen buffer to a
- file (with optional drive and path
- specifications), and
-
- BLOAD filespec
-
- writes the saved image back to the screen
- buffer.
-
- LOWRES and HIGHRES are used in batch files
- with BLOAD to set the appropriate display
- resolution.
-
- Example: Create the following batch file, SAVE.BAT,
- using an ASCII word processor, EDLIN, or COPY
- CON:
-
- ECHO OFF
- DRAW DRAW.DAT/F
- BSAVE PICTURE
-
- Now, similarly create a second batch file,
- INSTANT.BAT:
-
- ECHO OFF
- LOWRES
- BLOAD PICTURE
- PLAY STING.DAT/F
- PAUSE > NUL
- MODE CO80
-
- If you now enter INSTANT at the DOS prompt
- the picture of two con men will appear, with
- appropriate musical background. Pressing any
- keystroke will clear the display.
-
- Note:
-
- 1. The PAUSE > NUL line in INSTANT.BAT
- prevents the DOS prompt from intruding
- on the picture, but will not work on DOS
- versions prior to DOS 3.